<?php
/**
 * Opencart 1.5.0.x tnt2011 Post module
 *
 * @version $Id$ = 1.5.0.beta
 * 10 mei 2011 Gerrit Bouweriks voor Opencart 1.5.0.x
 */
class ControllerShippingTNT2011 extends Controller {
	private $error = array();

	public function index() {
		$this->load->language('shipping/tnt2011');

		$this->document->setTitle = $this->language->get('heading_title');

		$this->load->model('setting/setting');

		if (($this->request->server['REQUEST_METHOD'] == 'POST') && ($this->validate())) {
			$this->model_setting_setting->editSetting('tnt2011', $this->request->post);

			$this->session->data['success'] = $this->language->get('text_success');

			$this->redirect($this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL'));
		}

		$this->data['heading_title'] = $this->language->get('heading_title');

		$this->data['text_enabled'] = $this->language->get('text_enabled');
		$this->data['text_disabled'] = $this->language->get('text_disabled');
		$this->data['text_all_zones'] = $this->language->get('text_all_zones');
		$this->data['text_none'] = $this->language->get('text_none');
		$this->data['text_yes'] = $this->language->get('text_yes');
		$this->data['text_no'] = $this->language->get('text_no');
		$this->data['text_countries'] = $this->language->get('text_countries');
		$this->data['text_countries_rest'] = $this->language->get('text_countries_rest');
		$this->data['text_winkel'] = $this->language->get('text_winkel');


		$this->data['tab_briefpost'] = $this->language->get('tab_briefpost');
		$this->data['tab_nederland'] = $this->language->get('tab_nederland');
		$this->data['tab_europa_1'] = $this->language->get('tab_europa_1');
		$this->data['tab_europa_2'] = $this->language->get('tab_europa_2');
		$this->data['tab_europa_3'] = $this->language->get('tab_europa_3');
		$this->data['tab_wereld'] = $this->language->get('tab_wereld');

		$this->data['entry_tnt2011_briefpost_nl'] = $this->language->get('entry_tnt2011_briefpost_nl');
		$this->data['entry_tnt2011_briefpost_aangetekend_nl'] = $this->language->get('entry_tnt2011_briefpost_aangetekend_nl');
		$this->data['entry_tnt2011_briefpost_rembours_nl'] = $this->language->get('entry_tnt2011_briefpost_rembours_nl');

		$this->data['entry_tnt2011_briefpost_eu'] = $this->language->get('entry_tnt2011_briefpost_eu');
		$this->data['entry_tnt2011_briefpost_aangetekend_eu'] = $this->language->get('entry_tnt2011_briefpost_aangetekend_eu');

		$this->data['entry_tnt2011_briefpost_row'] = $this->language->get('entry_tnt2011_briefpost_row');
		$this->data['entry_tnt2011_briefpost_aangetekend_row'] = $this->language->get('entry_tnt2011_briefpost_aangetekend_row');


		$this->data['entry_tnt2011_nl'] = $this->language->get('entry_tnt2011_nl');
		$this->data['entry_tnt2011_nl_aantekenen'] = $this->language->get('entry_tnt2011_nl_aantekenen');
		$this->data['entry_tnt2011_nl_verzekerd'] = $this->language->get('entry_tnt2011_nl_verzekerd');
		$this->data['entry_tnt2011_nl_rembours'] = $this->language->get('entry_tnt2011_nl_rembours');
		$this->data['entry_tnt2011_nl_spoed'] = $this->language->get('entry_tnt2011_nl_spoed');

		$this->data['entry_tnt2011_eu1'] = $this->language->get('entry_tnt2011_eu1');
		$this->data['entry_tnt2011_eu1_aantekenen'] = $this->language->get('entry_tnt2011_eu1_aantekenen');
		$this->data['entry_tnt2011_eu1_verzekerd'] = $this->language->get('entry_tnt2011_eu1_verzekerd');
		$this->data['entry_tnt2011_eu1_spoed'] = $this->language->get('entry_tnt2011_eu1_spoed');

		$this->data['entry_tnt2011_eu2'] = $this->language->get('entry_tnt2011_eu2');
		$this->data['entry_tnt2011_eu2_aantekenen'] = $this->language->get('entry_tnt2011_eu2_aantekenen');
		$this->data['entry_tnt2011_eu2_verzekerd'] = $this->language->get('entry_tnt2011_eu2_verzekerd');
		$this->data['entry_tnt2011_eu2_spoed'] = $this->language->get('entry_tnt2011_eu2_spoed');

		$this->data['entry_tnt2011_eu3'] = $this->language->get('entry_tnt2011_eu3');
		$this->data['entry_tnt2011_eu3_aantekenen'] = $this->language->get('entry_tnt2011_eu3_aantekenen');
		$this->data['entry_tnt2011_eu3_verzekerd'] = $this->language->get('entry_tnt2011_eu3_verzekerd');

		$this->data['entry_tnt2011_wereld'] = $this->language->get('entry_tnt2011_wereld');
		$this->data['entry_tnt2011_wereld_aantekenen'] = $this->language->get('entry_tnt2011_wereld_aantekenen');
		$this->data['entry_tnt2011_wereld_verzekerd'] = $this->language->get('entry_tnt2011_wereld_verzekerd');

		$this->data['entry_service'] = $this->language->get('entry_service');
		$this->data['entry_display_weight'] = $this->language->get('entry_display_weight');
		$this->data['entry_display_insurance'] = $this->language->get('entry_display_insurance');
		$this->data['entry_display_time'] = $this->language->get('entry_display_time');
		$this->data['entry_use_freeshipping'] = $this->language->get('entry_use_freeshipping');
		$this->data['entry_tax'] = $this->language->get('entry_tax');
		$this->data['entry_geo_zone'] = $this->language->get('entry_geo_zone');
		$this->data['entry_status'] = $this->language->get('entry_status');
		$this->data['entry_sort_order'] = $this->language->get('entry_sort_order');
		$this->data['entry_max_briefwaarde'] = $this->language->get('entry_max_briefwaarde');
		$this->data['entry_max_pakketwaarde'] = $this->language->get('entry_max_pakketwaarde');

		$this->data['entry_discount_nl_mail'] = $this->language->get('entry_discount_nl_mail');
		$this->data['entry_discount_eu1_mail'] = $this->language->get('entry_discount_eu1_mail');
		$this->data['entry_discount_eu2_mail'] = $this->language->get('entry_discount_eu2_mail');
		$this->data['entry_discount_eu3_mail'] = $this->language->get('entry_discount_eu3_mail');
		$this->data['entry_discount_world_mail'] = $this->language->get('entry_discount_world_mail');

		$this->data['entry_discount_nl_parcel'] = $this->language->get('entry_discount_nl_parcel');
		$this->data['entry_discount_eu1_parcel'] = $this->language->get('entry_discount_eu1_parcel');
		$this->data['entry_discount_eu2_parcel'] = $this->language->get('entry_discount_eu2_parcel');
		$this->data['entry_discount_eu3_parcel'] = $this->language->get('entry_discount_eu3_parcel');
		$this->data['entry_discount_world_parcel'] = $this->language->get('entry_discount_world_parcel');

		$this->data['button_save'] = $this->language->get('button_save');
		$this->data['button_cancel'] = $this->language->get('button_cancel');

		$this->data['tab_general'] = $this->language->get('tab_general');

		$this->data['tab_general_settings'] = $this->language->get('tab_general_settings');
		$this->data['tab_general_discount'] = $this->language->get('tab_general_discount');
		$this->data['tab_general_discount_parcel'] = $this->language->get('tab_general_discount_parcel');

		// Placeholder text files
		$this->data['ph_standard'] = $this->language->get('ph_standard');
		$this->data['ph_ensured'] = $this->language->get('ph_ensured');
		$this->data['ph_registered'] = $this->language->get('ph_registered');
		$this->data['ph_rush'] = $this->language->get('ph_rush');
		$this->data['ph_pod'] = $this->language->get('ph_pod');
		$this->data['ph_amount'] = $this->language->get('ph_amount');


		if (isset($this->error['warning'])) {
			$this->data['error_warning'] = $this->error['warning'];
		} else {
			$this->data['error_warning'] = '';
		}

		$this->data['breadcrumbs'] = array();

		$this->data['breadcrumbs'][] = array(
       		'text'      => $this->language->get('text_home'),
			'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
      		'separator' => false
   		);

		$this->data['breadcrumbs'][] = array(
       		'text'      => $this->language->get('text_shipping'),
			'href'      => $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL'),
      		'separator' => ' :: '
   		);

		$this->data['breadcrumbs'][] = array(
       		'text'      => $this->language->get('heading_title'),
			'href'      => $this->url->link('shipping/tnt2011', 'token=' . $this->session->data['token'], 'SSL'),
      		'separator' => ' :: '
   		);

		$this->data['action'] = $this->url->link('shipping/tnt2011', 'token=' . $this->session->data['token'], 'SSL');

		$this->data['cancel'] = $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL');

		// Brief Post
		// Nederland
		if (isset($this->request->post['tnt2011_briefpost_nl_20'])) {
			$this->data['tnt2011_briefpost_nl_20'] = $this->request->post['tnt2011_briefpost_nl_20'];
		} else {
			$this->data['tnt2011_briefpost_nl_20'] = $this->config->get('tnt2011_briefpost_nl_20');
		}

		if (isset($this->request->post['tnt2011_briefpost_nl_50'])) {
			$this->data['tnt2011_briefpost_nl_50'] = $this->request->post['tnt2011_briefpost_nl_50'];
		} else {
			$this->data['tnt2011_briefpost_nl_50'] = $this->config->get('tnt2011_briefpost_nl_50');
		}

		if (isset($this->request->post['tnt2011_briefpost_nl_100'])) {
			$this->data['tnt2011_briefpost_nl_100'] = $this->request->post['tnt2011_briefpost_nl_100'];
		} else {
			$this->data['tnt2011_briefpost_nl_100'] = $this->config->get('tnt2011_briefpost_nl_100');
		}

		if (isset($this->request->post['tnt2011_briefpost_nl_250'])) {
			$this->data['tnt2011_briefpost_nl_250'] = $this->request->post['tnt2011_briefpost_nl_250'];
		} else {
			$this->data['tnt2011_briefpost_nl_250'] = $this->config->get('tnt2011_briefpost_nl_250');
		}

		if (isset($this->request->post['tnt2011_briefpost_nl_500'])) {
			$this->data['tnt2011_briefpost_nl_500'] = $this->request->post['tnt2011_briefpost_nl_500'];
		} else {
			$this->data['tnt2011_briefpost_nl_500'] = $this->config->get('tnt2011_briefpost_nl_500');
		}

		if (isset($this->request->post['tnt2011_briefpost_nl_2000'])) {
			$this->data['tnt2011_briefpost_nl_2000'] = $this->request->post['tnt2011_briefpost_nl_2000'];
		} else {
			$this->data['tnt2011_briefpost_nl_2000'] = $this->config->get('tnt2011_briefpost_nl_2000');
		}

		// Briefpost Aangetekend NL
		if (isset($this->request->post['tnt2011_briefpost_aantekenen_nl_2000'])) {
			$this->data['tnt2011_briefpost_aantekenen_nl_2000'] = $this->request->post['tnt2011_briefpost_aantekenen_nl_2000'];
		} else {
			$this->data['tnt2011_briefpost_aantekenen_nl_2000'] = $this->config->get('tnt2011_briefpost_aantekenen_nl_2000');
		}

		// Briefpost Rembours NL
		if (isset($this->request->post['tnt2011_briefpost_rembours_nl_2000'])) {
			$this->data['tnt2011_briefpost_rembours_nl_2000'] = $this->request->post['tnt2011_briefpost_rembours_nl_2000'];
		} else {
			$this->data['tnt2011_briefpost_rembours_nl_2000'] = $this->config->get('tnt2011_briefpost_rembours_nl_2000');
		}

		// Europa
		if (isset($this->request->post['tnt2011_briefpost_eu_20'])) {
			$this->data['tnt2011_briefpost_eu_20'] = $this->request->post['tnt2011_briefpost_eu_20'];
		} else {
			$this->data['tnt2011_briefpost_eu_20'] = $this->config->get('tnt2011_briefpost_eu_20');
		}

		if (isset($this->request->post['tnt2011_briefpost_eu_50'])) {
			$this->data['tnt2011_briefpost_eu_50'] = $this->request->post['tnt2011_briefpost_eu_50'];
		} else {
			$this->data['tnt2011_briefpost_eu_50'] = $this->config->get('tnt2011_briefpost_eu_50');
		}

		if (isset($this->request->post['tnt2011_briefpost_eu_100'])) {
			$this->data['tnt2011_briefpost_eu_100'] = $this->request->post['tnt2011_briefpost_eu_100'];
		} else {
			$this->data['tnt2011_briefpost_eu_100'] = $this->config->get('tnt2011_briefpost_eu_100');
		}

		if (isset($this->request->post['tnt2011_briefpost_eu_250'])) {
			$this->data['tnt2011_briefpost_eu_250'] = $this->request->post['tnt2011_briefpost_eu_250'];
		} else {
			$this->data['tnt2011_briefpost_eu_250'] = $this->config->get('tnt2011_briefpost_eu_250');
		}

		if (isset($this->request->post['tnt2011_briefpost_eu_500'])) {
			$this->data['tnt2011_briefpost_eu_500'] = $this->request->post['tnt2011_briefpost_eu_500'];
		} else {
			$this->data['tnt2011_briefpost_eu_500'] = $this->config->get('tnt2011_briefpost_eu_500');
		}

		if (isset($this->request->post['tnt2011_briefpost_eu_2000'])) {
			$this->data['tnt2011_briefpost_eu_2000'] = $this->request->post['tnt2011_briefpost_eu_2000'];
		} else {
			$this->data['tnt2011_briefpost_eu_2000'] = $this->config->get('tnt2011_briefpost_eu_2000');
		}

		// Briefpost Aangetekend EU
		if (isset($this->request->post['tnt2011_briefpost_aantekenen_eu_2000'])) {
			$this->data['tnt2011_briefpost_aantekenen_eu_2000'] = $this->request->post['tnt2011_briefpost_aantekenen_eu_2000'];
		} else {
			$this->data['tnt2011_briefpost_aantekenen_eu_2000'] = $this->config->get('tnt2011_briefpost_aantekenen_eu_2000');
		}

		// Rest of World
		if (isset($this->request->post['tnt2011_briefpost_row_20'])) {
			$this->data['tnt2011_briefpost_row_20'] = $this->request->post['tnt2011_briefpost_row_20'];
		} else {
			$this->data['tnt2011_briefpost_row_20'] = $this->config->get('tnt2011_briefpost_row_20');
		}

		if (isset($this->request->post['tnt2011_briefpost_row_50'])) {
			$this->data['tnt2011_briefpost_row_50'] = $this->request->post['tnt2011_briefpost_row_50'];
		} else {
			$this->data['tnt2011_briefpost_row_50'] = $this->config->get('tnt2011_briefpost_row_50');
		}

		if (isset($this->request->post['tnt2011_briefpost_row_100'])) {
			$this->data['tnt2011_briefpost_row_100'] = $this->request->post['tnt2011_briefpost_row_100'];
		} else {
			$this->data['tnt2011_briefpost_row_100'] = $this->config->get('tnt2011_briefpost_row_100');
		}

		if (isset($this->request->post['tnt2011_briefpost_row_250'])) {
			$this->data['tnt2011_briefpost_row_250'] = $this->request->post['tnt2011_briefpost_row_250'];
		} else {
			$this->data['tnt2011_briefpost_row_250'] = $this->config->get('tnt2011_briefpost_row_250');
		}

		if (isset($this->request->post['tnt2011_briefpost_row_500'])) {
			$this->data['tnt2011_briefpost_row_500'] = $this->request->post['tnt2011_briefpost_row_500'];
		} else {
			$this->data['tnt2011_briefpost_row_500'] = $this->config->get('tnt2011_briefpost_row_500');
		}

		if (isset($this->request->post['tnt2011_briefpost_row_2000'])) {
			$this->data['tnt2011_briefpost_row_2000'] = $this->request->post['tnt2011_briefpost_row_2000'];
		} else {
			$this->data['tnt2011_briefpost_row_2000'] = $this->config->get('tnt2011_briefpost_row_2000');
		}

		// aangetekend ROW
		if (isset($this->request->post['tnt2011_briefpost_aantekenen_row_2000'])) {
			$this->data['tnt2011_briefpost_aantekenen_row_2000'] = $this->request->post['tnt2011_briefpost_aantekenen_row_2000'];
		} else {
			$this->data['tnt2011_briefpost_aantekenen_row_2000'] = $this->config->get('tnt2011_briefpost_aantekenen_row_2000');
		}

		// Nederland
		if (isset($this->request->post['tnt2011_nl_10'])) {
			$this->data['tnt2011_nl_10'] = $this->request->post['tnt2011_nl_10'];
		} else {
			$this->data['tnt2011_nl_10'] = $this->config->get('tnt2011_nl_10');
		}

		if (isset($this->request->post['tnt2011_nl_30'])) {
			$this->data['tnt2011_nl_30'] = $this->request->post['tnt2011_nl_30'];
		} else {
			$this->data['tnt2011_nl_30'] = $this->config->get('tnt2011_nl_30');
		}

		if (isset($this->request->post['tnt2011_nl_aantekenen_10'])) {
			$this->data['tnt2011_nl_aantekenen_10'] = $this->request->post['tnt2011_nl_aantekenen_10'];
		} else {
			$this->data['tnt2011_nl_aantekenen_10'] = $this->config->get('tnt2011_nl_aantekenen_10');
		}

		if (isset($this->request->post['tnt2011_nl_aantekenen_30'])) {
			$this->data['tnt2011_nl_aantekenen_30'] = $this->request->post['tnt2011_nl_aantekenen_30'];
		} else {
			$this->data['tnt2011_nl_aantekenen_30'] = $this->config->get('tnt2011_nl_aantekenen_30');
		}

		if (isset($this->request->post['tnt2011_nl_verzekerd_10'])) {
			$this->data['tnt2011_nl_verzekerd_10'] = $this->request->post['tnt2011_nl_verzekerd_10'];
		} else {
			$this->data['tnt2011_nl_verzekerd_10'] = $this->config->get('tnt2011_nl_verzekerd_10');
		}

		if (isset($this->request->post['tnt2011_nl_verzekerd_30'])) {
			$this->data['tnt2011_nl_verzekerd_30'] = $this->request->post['tnt2011_nl_verzekerd_30'];
		} else {
			$this->data['tnt2011_nl_verzekerd_30'] = $this->config->get('tnt2011_nl_verzekerd_30');
		}

		if (isset($this->request->post['tnt2011_nl_spoed_02'])) {
			$this->data['tnt2011_nl_spoed_02'] = $this->request->post['tnt2011_nl_spoed_02'];
		} else {
			$this->data['tnt2011_nl_spoed_02'] = $this->config->get('tnt2011_nl_spoed_02');
		}

		if (isset($this->request->post['tnt2011_nl_spoed_05'])) {
			$this->data['tnt2011_nl_spoed_05'] = $this->request->post['tnt2011_nl_spoed_05'];
		} else {
			$this->data['tnt2011_nl_spoed_05'] = $this->config->get('tnt2011_nl_spoed_05');
		}

		if (isset($this->request->post['tnt2011_nl_spoed_10'])) {
			$this->data['tnt2011_nl_spoed_10'] = $this->request->post['tnt2011_nl_spoed_10'];
		} else {
			$this->data['tnt2011_nl_spoed_10'] = $this->config->get('tnt2011_nl_spoed_10');
		}

		if (isset($this->request->post['tnt2011_nl_rembours_10'])) {
			$this->data['tnt2011_nl_rembours_10'] = $this->request->post['tnt2011_nl_rembours_10'];
		} else {
			$this->data['tnt2011_nl_rembours_10'] = $this->config->get('tnt2011_nl_rembours_10');
		}

		if (isset($this->request->post['tnt2011_nl_rebours_30'])) {
			$this->data['tnt2011_nl_rembours_30'] = $this->request->post['tnt2011_nl_rembours_30'];
		} else {
			$this->data['tnt2011_nl_rembours_30'] = $this->config->get('tnt2011_nl_rembours_30');
		}
		// Eind Nederland

		// Europa I
		if (isset($this->request->post['tnt2011_eu1_02'])) {
			$this->data['tnt2011_eu1_02'] = $this->request->post['tnt2011_eu1_02'];
		} else {
			$this->data['tnt2011_eu1_02'] = $this->config->get('tnt2011_eu1_02');
		}

		if (isset($this->request->post['tnt2011_eu1_05'])) {
			$this->data['tnt2011_eu1_05'] = $this->request->post['tnt2011_eu1_05'];
		} else {
			$this->data['tnt2011_eu1_05'] = $this->config->get('tnt2011_eu1_05');
		}

		if (isset($this->request->post['tnt2011_eu1_10'])) {
			$this->data['tnt2011_eu1_10'] = $this->request->post['tnt2011_eu1_10'];
		} else {
			$this->data['tnt2011_eu1_10'] = $this->config->get('tnt2011_eu1_10');
		}

		if (isset($this->request->post['tnt2011_eu1_20'])) {
			$this->data['tnt2011_eu1_20'] = $this->request->post['tnt2011_eu1_20'];
		} else {
			$this->data['tnt2011_eu1_20'] = $this->config->get('tnt2011_eu1_20');
		}

		if (isset($this->request->post['tnt2011_eu1_30'])) {
			$this->data['tnt2011_eu1_30'] = $this->request->post['tnt2011_eu1_30'];
		} else {
			$this->data['tnt2011_eu1_30'] = $this->config->get('tnt2011_eu1_30');
		}

		if (isset($this->request->post['tnt2011_eu1_aantekenen_02'])) {
			$this->data['tnt2011_eu1_aantekenen_02'] = $this->request->post['tnt2011_eu1_aantekenen_02'];
		} else {
			$this->data['tnt2011_eu1_aantekenen_02'] = $this->config->get('tnt2011_eu1_aantekenen_02');
		}

		if (isset($this->request->post['tnt2011_eu1_aantekenen_05'])) {
			$this->data['tnt2011_eu1_aantekenen_05'] = $this->request->post['tnt2011_eu1_aantekenen_05'];
		} else {
			$this->data['tnt2011_eu1_aantekenen_05'] = $this->config->get('tnt2011_eu1_aantekenen_05');
		}

		if (isset($this->request->post['tnt2011_eu1_aantekenen_10'])) {
			$this->data['tnt2011_eu1_aantekenen_10'] = $this->request->post['tnt2011_eu1_aantekenen_10'];
		} else {
			$this->data['tnt2011_eu1_aantekenen_10'] = $this->config->get('tnt2011_eu1_aantekenen_10');
		}

		if (isset($this->request->post['tnt2011_eu1_aantekenen_20'])) {
			$this->data['tnt2011_eu1_aantekenen_20'] = $this->request->post['tnt2011_eu1_aantekenen_20'];
		} else {
			$this->data['tnt2011_eu1_aantekenen_20'] = $this->config->get('tnt2011_eu1_aantekenen_20');
		}

		if (isset($this->request->post['tnt2011_eu1_aantekenen_30'])) {
			$this->data['tnt2011_eu1_aantekenen_30'] = $this->request->post['tnt2011_eu1_aantekenen_30'];
		} else {
			$this->data['tnt2011_eu1_aantekenen_30'] = $this->config->get('tnt2011_eu1_aantekenen_30');
		}

		if (isset($this->request->post['tnt2011_eu1_verzekerd_02'])) {
			$this->data['tnt2011_eu1_verzekerd_02'] = $this->request->post['tnt2011_eu1_verzekerd_02'];
		} else {
			$this->data['tnt2011_eu1_verzekerd_02'] = $this->config->get('tnt2011_eu1_verzekerd_02');
		}

		if (isset($this->request->post['tnt2011_eu1_verzekerd_05'])) {
			$this->data['tnt2011_eu1_verzekerd_05'] = $this->request->post['tnt2011_eu1_verzekerd_05'];
		} else {
			$this->data['tnt2011_eu1_verzekerd_05'] = $this->config->get('tnt2011_eu1_verzekerd_05');
		}

		if (isset($this->request->post['tnt2011_eu1_verzekerd_10'])) {
			$this->data['tnt2011_eu1_verzekerd_10'] = $this->request->post['tnt2011_eu1_verzekerd_10'];
		} else {
			$this->data['tnt2011_eu1_verzekerd_10'] = $this->config->get('tnt2011_eu1_verzekerd_10');
		}

		if (isset($this->request->post['tnt2011_eu1_verzekerd_20'])) {
			$this->data['tnt2011_eu1_verzekerd_20'] = $this->request->post['tnt2011_eu1_verzekerd_20'];
		} else {
			$this->data['tnt2011_eu1_verzekerd_20'] = $this->config->get('tnt2011_eu1_verzekerd_20');
		}

		if (isset($this->request->post['tnt2011_eu1_verzekerd_30'])) {
			$this->data['tnt2011_eu1_verzekerd_30'] = $this->request->post['tnt2011_eu1_verzekerd_30'];
		} else {
			$this->data['tnt2011_eu1_verzekerd_30'] = $this->config->get('tnt2011_eu1_verzekerd_30');
		}

		if (isset($this->request->post['tnt2011_eu1_spoed_02'])) {
			$this->data['tnt2011_eu1_spoed_02'] = $this->request->post['tnt2011_eu1_spoed_02'];
		} else {
			$this->data['tnt2011_eu1_spoed_02'] = $this->config->get('tnt2011_eu1_spoed_02');
		}

		if (isset($this->request->post['tnt2011_eu1_spoed_05'])) {
			$this->data['tnt2011_eu1_spoed_05'] = $this->request->post['tnt2011_eu1_spoed_05'];
		} else {
			$this->data['tnt2011_eu1_spoed_05'] = $this->config->get('tnt2011_eu1_spoed_05');
		}

		if (isset($this->request->post['tnt2011_eu1_spoed_10'])) {
			$this->data['tnt2011_eu1_spoed_10'] = $this->request->post['tnt2011_eu1_spoed_10'];
		} else {
			$this->data['tnt2011_eu1_spoed_10'] = $this->config->get('tnt2011_eu1_spoed_10');
		}
		// Eind Europa I

		// Europa II
		if (isset($this->request->post['tnt2011_eu2_02'])) {
			$this->data['tnt2011_eu2_02'] = $this->request->post['tnt2011_eu2_02'];
		} else {
			$this->data['tnt2011_eu2_02'] = $this->config->get('tnt2011_eu2_02');
		}

		if (isset($this->request->post['tnt2011_eu2_05'])) {
			$this->data['tnt2011_eu2_05'] = $this->request->post['tnt2011_eu2_05'];
		} else {
			$this->data['tnt2011_eu2_05'] = $this->config->get('tnt2011_eu2_05');
		}

		if (isset($this->request->post['tnt2011_eu2_10'])) {
			$this->data['tnt2011_eu2_10'] = $this->request->post['tnt2011_eu2_10'];
		} else {
			$this->data['tnt2011_eu2_10'] = $this->config->get('tnt2011_eu2_10');
		}

		if (isset($this->request->post['tnt2011_eu2_20'])) {
			$this->data['tnt2011_eu2_20'] = $this->request->post['tnt2011_eu2_20'];
		} else {
			$this->data['tnt2011_eu2_20'] = $this->config->get('tnt2011_eu2_20');
		}

		if (isset($this->request->post['tnt2011_eu2_30'])) {
			$this->data['tnt2011_eu2_30'] = $this->request->post['tnt2011_eu2_30'];
		} else {
			$this->data['tnt2011_eu2_30'] = $this->config->get('tnt2011_eu2_30');
		}

		if (isset($this->request->post['tnt2011_eu2_aantekenen_02'])) {
			$this->data['tnt2011_eu2_aantekenen_02'] = $this->request->post['tnt2011_eu2_aantekenen_02'];
		} else {
			$this->data['tnt2011_eu2_aantekenen_02'] = $this->config->get('tnt2011_eu2_aantekenen_02');
		}

		if (isset($this->request->post['tnt2011_eu2_aantekenen_05'])) {
			$this->data['tnt2011_eu2_aantekenen_05'] = $this->request->post['tnt2011_eu2_aantekenen_05'];
		} else {
			$this->data['tnt2011_eu2_aantekenen_05'] = $this->config->get('tnt2011_eu2_aantekenen_05');
		}

		if (isset($this->request->post['tnt2011_eu2_aantekenen_10'])) {
			$this->data['tnt2011_eu2_aantekenen_10'] = $this->request->post['tnt2011_eu2_aantekenen_10'];
		} else {
			$this->data['tnt2011_eu2_aantekenen_10'] = $this->config->get('tnt2011_eu2_aantekenen_10');
		}

		if (isset($this->request->post['tnt2011_eu2_aantekenen_20'])) {
			$this->data['tnt2011_eu2_aantekenen_20'] = $this->request->post['tnt2011_eu2_aantekenen_20'];
		} else {
			$this->data['tnt2011_eu2_aantekenen_20'] = $this->config->get('tnt2011_eu2_aantekenen_20');
		}

		if (isset($this->request->post['tnt2011_eu2_aantekenen_30'])) {
			$this->data['tnt2011_eu2_aantekenen_30'] = $this->request->post['tnt2011_eu2_aantekenen_30'];
		} else {
			$this->data['tnt2011_eu2_aantekenen_30'] = $this->config->get('tnt2011_eu2_aantekenen_30');
		}

		if (isset($this->request->post['tnt2011_eu2_verzekerd_02'])) {
			$this->data['tnt2011_eu2_verzekerd_02'] = $this->request->post['tnt2011_eu2_verzekerd_02'];
		} else {
			$this->data['tnt2011_eu2_verzekerd_02'] = $this->config->get('tnt2011_eu2_verzekerd_02');
		}

		if (isset($this->request->post['tnt2011_eu2_verzekerd_05'])) {
			$this->data['tnt2011_eu2_verzekerd_05'] = $this->request->post['tnt2011_eu2_verzekerd_05'];
		} else {
			$this->data['tnt2011_eu2_verzekerd_05'] = $this->config->get('tnt2011_eu2_verzekerd_05');
		}

		if (isset($this->request->post['tnt2011_eu2_verzekerd_10'])) {
			$this->data['tnt2011_eu2_verzekerd_10'] = $this->request->post['tnt2011_eu2_verzekerd_10'];
		} else {
			$this->data['tnt2011_eu2_verzekerd_10'] = $this->config->get('tnt2011_eu2_verzekerd_10');
		}

		if (isset($this->request->post['tnt2011_eu2_verzekerd_20'])) {
			$this->data['tnt2011_eu2_verzekerd_20'] = $this->request->post['tnt2011_eu2_verzekerd_20'];
		} else {
			$this->data['tnt2011_eu2_verzekerd_20'] = $this->config->get('tnt2011_eu2_verzekerd_20');
		}

		if (isset($this->request->post['tnt2011_eu2_verzekerd_30'])) {
			$this->data['tnt2011_eu2_verzekerd_30'] = $this->request->post['tnt2011_eu2_verzekerd_30'];
		} else {
			$this->data['tnt2011_eu2_verzekerd_30'] = $this->config->get('tnt2011_eu2_verzekerd_30');
		}

		if (isset($this->request->post['tnt2011_eu2_spoed_02'])) {
			$this->data['tnt2011_eu2_spoed_02'] = $this->request->post['tnt2011_eu2_spoed_02'];
		} else {
			$this->data['tnt2011_eu2_spoed_02'] = $this->config->get('tnt2011_eu2_spoed_02');
		}

		if (isset($this->request->post['tnt2011_eu2_spoed_05'])) {
			$this->data['tnt2011_eu2_spoed_05'] = $this->request->post['tnt2011_eu2_spoed_05'];
		} else {
			$this->data['tnt2011_eu2_spoed_05'] = $this->config->get('tnt2011_eu2_spoed_05');
		}

		if (isset($this->request->post['tnt2011_eu2_spoed_10'])) {
			$this->data['tnt2011_eu2_spoed_10'] = $this->request->post['tnt2011_eu2_spoed_10'];
		} else {
			$this->data['tnt2011_eu2_spoed_10'] = $this->config->get('tnt2011_eu2_spoed_10');
		}
		// Eind Europa II

		// Europa III
		if (isset($this->request->post['tnt2011_eu3_02'])) {
			$this->data['tnt2011_eu3_02'] = $this->request->post['tnt2011_eu3_02'];
		} else {
			$this->data['tnt2011_eu3_02'] = $this->config->get('tnt2011_eu3_02');
		}

		if (isset($this->request->post['tnt2011_eu3_05'])) {
			$this->data['tnt2011_eu3_05'] = $this->request->post['tnt2011_eu3_05'];
		} else {
			$this->data['tnt2011_eu3_05'] = $this->config->get('tnt2011_eu3_05');
		}

		if (isset($this->request->post['tnt2011_eu3_10'])) {
			$this->data['tnt2011_eu3_10'] = $this->request->post['tnt2011_eu3_10'];
		} else {
			$this->data['tnt2011_eu3_10'] = $this->config->get('tnt2011_eu3_10');
		}

		if (isset($this->request->post['tnt2011_eu3_20'])) {
			$this->data['tnt2011_eu3_20'] = $this->request->post['tnt2011_eu3_20'];
		} else {
			$this->data['tnt2011_eu3_20'] = $this->config->get('tnt2011_eu3_20');
		}

		if (isset($this->request->post['tnt2011_eu3_aantekenen_02'])) {
			$this->data['tnt2011_eu3_aantekenen_02'] = $this->request->post['tnt2011_eu3_aantekenen_02'];
		} else {
			$this->data['tnt2011_eu3_aantekenen_02'] = $this->config->get('tnt2011_eu3_aantekenen_02');
		}

		if (isset($this->request->post['tnt2011_eu3_aantekenen_05'])) {
			$this->data['tnt2011_eu3_aantekenen_05'] = $this->request->post['tnt2011_eu3_aantekenen_05'];
		} else {
			$this->data['tnt2011_eu3_aantekenen_05'] = $this->config->get('tnt2011_eu3_aantekenen_05');
		}

		if (isset($this->request->post['tnt2011_eu3_aantekenen_10'])) {
			$this->data['tnt2011_eu3_aantekenen_10'] = $this->request->post['tnt2011_eu3_aantekenen_10'];
		} else {
			$this->data['tnt2011_eu3_aantekenen_10'] = $this->config->get('tnt2011_eu3_aantekenen_10');
		}

		if (isset($this->request->post['tnt2011_eu3_aantekenen_20'])) {
			$this->data['tnt2011_eu3_aantekenen_20'] = $this->request->post['tnt2011_eu3_aantekenen_20'];
		} else {
			$this->data['tnt2011_eu3_aantekenen_20'] = $this->config->get('tnt2011_eu3_aantekenen_20');
		}

		if (isset($this->request->post['tnt2011_eu3_verzekerd_02'])) {
			$this->data['tnt2011_eu3_verzekerd_02'] = $this->request->post['tnt2011_eu3_verzekerd_02'];
		} else {
			$this->data['tnt2011_eu3_verzekerd_02'] = $this->config->get('tnt2011_eu3_verzekerd_02');
		}

		if (isset($this->request->post['tnt2011_eu3_verzekerd_05'])) {
			$this->data['tnt2011_eu3_verzekerd_05'] = $this->request->post['tnt2011_eu3_verzekerd_05'];
		} else {
			$this->data['tnt2011_eu3_verzekerd_05'] = $this->config->get('tnt2011_eu3_verzekerd_05');
		}

		if (isset($this->request->post['tnt2011_eu3_verzekerd_10'])) {
			$this->data['tnt2011_eu3_verzekerd_10'] = $this->request->post['tnt2011_eu3_verzekerd_10'];
		} else {
			$this->data['tnt2011_eu3_verzekerd_10'] = $this->config->get('tnt2011_eu3_verzekerd_10');
		}

		if (isset($this->request->post['tnt2011_eu3_verzekerd_20'])) {
			$this->data['tnt2011_eu3_verzekerd_20'] = $this->request->post['tnt2011_eu3_verzekerd_20'];
		} else {
			$this->data['tnt2011_eu3_verzekerd_20'] = $this->config->get('tnt2011_eu3_verzekerd_20');
		}
		// Eind Europa III

		// Rest van de Wereld
		if (isset($this->request->post['tnt2011_wereld_02'])) {
			$this->data['tnt2011_wereld_02'] = $this->request->post['tnt2011_wereld_02'];
		} else {
			$this->data['tnt2011_wereld_02'] = $this->config->get('tnt2011_wereld_02');
		}

		if (isset($this->request->post['tnt2011_wereld_05'])) {
			$this->data['tnt2011_wereld_05'] = $this->request->post['tnt2011_wereld_05'];
		} else {
			$this->data['tnt2011_wereld_05'] = $this->config->get('tnt2011_wereld_05');
		}

		if (isset($this->request->post['tnt2011_wereld_10'])) {
			$this->data['tnt2011_wereld_10'] = $this->request->post['tnt2011_wereld_10'];
		} else {
			$this->data['tnt2011_wereld_10'] = $this->config->get('tnt2011_wereld_10');
		}

		if (isset($this->request->post['tnt2011_wereld_20'])) {
			$this->data['tnt2011_wereld_20'] = $this->request->post['tnt2011_wereld_20'];
		} else {
			$this->data['tnt2011_wereld_20'] = $this->config->get('tnt2011_wereld_20');
		}

		if (isset($this->request->post['tnt2011_wereld_aantekenen_02'])) {
			$this->data['tnt2011_wereld_aantekenen_02'] = $this->request->post['tnt2011_wereld_aantekenen_02'];
		} else {
			$this->data['tnt2011_wereld_aantekenen_02'] = $this->config->get('tnt2011_wereld_aantekenen_02');
		}

		if (isset($this->request->post['tnt2011_wereld_aantekenen_05'])) {
			$this->data['tnt2011_wereld_aantekenen_05'] = $this->request->post['tnt2011_wereld_aantekenen_05'];
		} else {
			$this->data['tnt2011_wereld_aantekenen_05'] = $this->config->get('tnt2011_wereld_aantekenen_05');
		}

		if (isset($this->request->post['tnt2011_wereld_aantekenen_10'])) {
			$this->data['tnt2011_wereld_aantekenen_10'] = $this->request->post['tnt2011_wereld_aantekenen_10'];
		} else {
			$this->data['tnt2011_wereld_aantekenen_10'] = $this->config->get('tnt2011_wereld_aantekenen_10');
		}

		if (isset($this->request->post['tnt2011_wereld_aantekenen_20'])) {
			$this->data['tnt2011_wereld_aantekenen_20'] = $this->request->post['tnt2011_wereld_aantekenen_20'];
		} else {
			$this->data['tnt2011_wereld_aantekenen_20'] = $this->config->get('tnt2011_wereld_aantekenen_20');
		}

		if (isset($this->request->post['tnt2011_wereld_verzekerd_02'])) {
			$this->data['tnt2011_wereld_verzekerd_02'] = $this->request->post['tnt2011_wereld_verzekerd_02'];
		} else {
			$this->data['tnt2011_wereld_verzekerd_02'] = $this->config->get('tnt2011_wereld_verzekerd_02');
		}

		if (isset($this->request->post['tnt2011_wereld_verzekerd_05'])) {
			$this->data['tnt2011_wereld_verzekerd_05'] = $this->request->post['tnt2011_wereld_verzekerd_05'];
		} else {
			$this->data['tnt2011_wereld_verzekerd_05'] = $this->config->get('tnt2011_wereld_verzekerd_05');
		}

		if (isset($this->request->post['tnt2011_wereld_verzekerd_10'])) {
			$this->data['tnt2011_wereld_verzekerd_10'] = $this->request->post['tnt2011_wereld_verzekerd_10'];
		} else {
			$this->data['tnt2011_wereld_verzekerd_10'] = $this->config->get('tnt2011_wereld_verzekerd_10');
		}

		if (isset($this->request->post['tnt2011_wereld_verzekerd_20'])) {
			$this->data['tnt2011_wereld_verzekerd_20'] = $this->request->post['tnt2011_wereld_verzekerd_20'];
		} else {
			$this->data['tnt2011_wereld_verzekerd_20'] = $this->config->get('tnt2011_wereld_verzekerd_20');
		}
		// Eind Rest van de Wereld

		// Settings
		if (isset($this->request->post['tnt2011_display_weight'])) {
			$this->data['tnt2011_display_weight'] = $this->request->post['tnt2011_display_weight'];
		} else {
			$this->data['tnt2011_display_weight'] = $this->config->get('tnt2011_display_weight');
		}

		if (isset($this->request->post['tnt2011_display_insurance'])) {
			$this->data['tnt2011_display_insurance'] = $this->request->post['tnt2011_display_insurance'];
		} else {
			$this->data['tnt2011_display_insurance'] = $this->config->get('tnt2011_display_insurance');
		}

		if (isset($this->request->post['tnt2011_display_time'])) {
			$this->data['tnt2011_display_time'] = $this->request->post['tnt2011_display_time'];
		} else {
			$this->data['tnt2011_display_time'] = $this->config->get('tnt2011_display_time');
		}

		if (isset($this->request->post['tnt2011_use_freeshipping'])) {
			$this->data['tnt2011_use_freeshipping'] = $this->request->post['tnt2011_use_freeshipping'];
		} else {
			$this->data['tnt2011_use_freeshipping'] = $this->config->get('tnt2011_use_freeshipping');
		}

		if (isset($this->request->post['tnt2011_max_briefwaarde'])) {
			$this->data['tnt2011_max_briefwaarde'] = $this->request->post['tnt2011_max_briefwaarde'];
		} else {
			$this->data['tnt2011_max_briefwaarde'] = $this->config->get('tnt2011_max_briefwaarde');
		}

		if (isset($this->request->post['tnt2011_max_pakketwaarde'])) {
			$this->data['tnt2011_max_pakketwaarde'] = $this->request->post['tnt2011_max_pakketwaarde'];
		} else {
			$this->data['tnt2011_max_pakketwaarde'] = $this->config->get('tnt2011_max_pakketwaarde');
		}

		$this->load->model('localisation/weight_class');

		$this->data['weight_classes'] = $this->model_localisation_weight_class->getWeightClasses();

		if (isset($this->request->post['tnt2011_tax_class_id'])) {
			$this->data['tnt2011_tax_class_id'] = $this->request->post['tnt2011_tax_class_id'];
		} else {
			$this->data['tnt2011_tax_class_id'] = $this->config->get('tnt2011_tax_class_id');
		}

		if (isset($this->request->post['tnt2011_geo_zone_id'])) {
			$this->data['tnt2011_geo_zone_id'] = $this->request->post['tnt2011_geo_zone_id'];
		} else {
			$this->data['tnt2011_geo_zone_id'] = $this->config->get('tnt2011_geo_zone_id');
		}

		if (isset($this->request->post['tnt2011_status'])) {
			$this->data['tnt2011_status'] = $this->request->post['tnt2011_status'];
		} else {
			$this->data['tnt2011_status'] = $this->config->get('tnt2011_status');
		}

		if (isset($this->request->post['tnt2011_sort_order'])) {
			$this->data['tnt2011_sort_order'] = $this->request->post['tnt2011_sort_order'];
		} else {
			$this->data['tnt2011_sort_order'] = $this->config->get('tnt2011_sort_order');
		}

		// check radio buttons

		// Brief Post
		if (isset($this->request->post['tnt2011_briefpost_nl_rb01'])) {
			$this->data['tnt2011_briefpost_nl_rb01'] = $this->request->post['tnt2011_briefpost_nl_rb01'];
		} else {
			$this->data['tnt2011_briefpost_nl_rb01'] = $this->config->get('tnt2011_briefpost_nl_rb01');
		}

		if (isset($this->request->post['tnt2011_briefpost_nl_rb02'])) {
			$this->data['tnt2011_briefpost_nl_rb02'] = $this->request->post['tnt2011_briefpost_nl_rb02'];
		} else {
			$this->data['tnt2011_briefpost_nl_rb02'] = $this->config->get('tnt2011_briefpost_nl_rb02');
		}

		if (isset($this->request->post['tnt2011_briefpost_nl_rb03'])) {
			$this->data['tnt2011_briefpost_nl_rb03'] = $this->request->post['tnt2011_briefpost_nl_rb03'];
		} else {
			$this->data['tnt2011_briefpost_nl_rb03'] = $this->config->get('tnt2011_briefpost_nl_rb03');
		}

		// Briefpost europa
		if (isset($this->request->post['tnt2011_briefpost_eu_rb01'])) {
			$this->data['tnt2011_briefpost_eu_rb01'] = $this->request->post['tnt2011_briefpost_eu_rb01'];
		} else {
			$this->data['tnt2011_briefpost_eu_rb01'] = $this->config->get('tnt2011_briefpost_eu_rb01');
		}

		if (isset($this->request->post['tnt2011_briefpost_eu_rb02'])) {
			$this->data['tnt2011_briefpost_eu_rb02'] = $this->request->post['tnt2011_briefpost_eu_rb02'];
		} else {
			$this->data['tnt2011_briefpost_eu_rb02'] = $this->config->get('tnt2011_briefpost_eu_rb02');
		}
		// Briefpost Rest of world
		if (isset($this->request->post['tnt2011_briefpost_row_rb01'])) {
			$this->data['tnt2011_briefpost_row_rb01'] = $this->request->post['tnt2011_briefpost_row_rb01'];
		} else {
			$this->data['tnt2011_briefpost_row_rb01'] = $this->config->get('tnt2011_briefpost_row_rb01');
		}

		if (isset($this->request->post['tnt2011_briefpost_row_rb02'])) {
			$this->data['tnt2011_briefpost_row_rb02'] = $this->request->post['tnt2011_briefpost_row_rb02'];
		} else {
			$this->data['tnt2011_briefpost_row_rb02'] = $this->config->get('tnt2011_briefpost_row_rb02');
		}


		// Nederland
		if (isset($this->request->post['tnt2011_nl_rb01'])) {
			$this->data['tnt2011_nl_rb01'] = $this->request->post['tnt2011_nl_rb01'];
		} else {
			$this->data['tnt2011_nl_rb01'] = $this->config->get('tnt2011_nl_rb01');
		}

		if (isset($this->request->post['tnt2011_nl_rb02'])) {
			$this->data['tnt2011_nl_rb02'] = $this->request->post['tnt2011_nl_rb02'];
		} else {
			$this->data['tnt2011_nl_rb02'] = $this->config->get('tnt2011_nl_rb02');
		}

		if (isset($this->request->post['tnt2011_nl_rb03'])) {
			$this->data['tnt2011_nl_rb03'] = $this->request->post['tnt2011_nl_rb03'];
		} else {
			$this->data['tnt2011_nl_rb03'] = $this->config->get('tnt2011_nl_rb03');
		}

		if (isset($this->request->post['tnt2011_nl_rb04'])) {
			$this->data['tnt2011_nl_rb04'] = $this->request->post['tnt2011_nl_rb04'];
		} else {
			$this->data['tnt2011_nl_rb04'] = $this->config->get('tnt2011_nl_rb04');
		}

		if (isset($this->request->post['tnt2011_nl_rb05'])) {
			$this->data['tnt2011_nl_rb05'] = $this->request->post['tnt2011_nl_rb05'];
		} else {
			$this->data['tnt2011_nl_rb05'] = $this->config->get('tnt2011_nl_rb05');
		}
		// Eind Nederland

		// Europa I
		if (isset($this->request->post['tnt2011_eu1_rb01'])) {
			$this->data['tnt2011_eu1_rb01'] = $this->request->post['tnt2011_eu1_rb01'];
		} else {
			$this->data['tnt2011_eu1_rb01'] = $this->config->get('tnt2011_eu1_rb01');
		}

		if (isset($this->request->post['tnt2011_eu1_rb02'])) {
			$this->data['tnt2011_eu1_rb02'] = $this->request->post['tnt2011_eu1_rb02'];
		} else {
			$this->data['tnt2011_eu1_rb02'] = $this->config->get('tnt2011_eu1_rb02');
		}

		if (isset($this->request->post['tnt2011_eu1_rb03'])) {
			$this->data['tnt2011_eu1_rb03'] = $this->request->post['tnt2011_eu1_rb03'];
		} else {
			$this->data['tnt2011_eu1_rb03'] = $this->config->get('tnt2011_eu1_rb03');
		}

		if (isset($this->request->post['tnt2011_eu1_rb05'])) {
			$this->data['tnt2011_eu1_rb05'] = $this->request->post['tnt2011_eu1_rb05'];
		} else {
			$this->data['tnt2011_eu1_rb05'] = $this->config->get('tnt2011_eu1_rb05');
		}
		// Eind Europa I

		// Europa II
		if (isset($this->request->post['tnt2011_eu2_rb01'])) {
			$this->data['tnt2011_eu2_rb01'] = $this->request->post['tnt2011_eu2_rb01'];
		} else {
			$this->data['tnt2011_eu2_rb01'] = $this->config->get('tnt2011_eu2_rb01');
		}

		if (isset($this->request->post['tnt2011_eu2_rb02'])) {
			$this->data['tnt2011_eu2_rb02'] = $this->request->post['tnt2011_eu2_rb02'];
		} else {
			$this->data['tnt2011_eu2_rb02'] = $this->config->get('tnt2011_eu2_rb02');
		}

		if (isset($this->request->post['tnt2011_eu2_rb03'])) {
			$this->data['tnt2011_eu2_rb03'] = $this->request->post['tnt2011_eu2_rb03'];
		} else {
			$this->data['tnt2011_eu2_rb03'] = $this->config->get('tnt2011_eu2_rb03');
		}

		if (isset($this->request->post['tnt2011_eu2_rb05'])) {
			$this->data['tnt2011_eu2_rb05'] = $this->request->post['tnt2011_eu2_rb05'];
		} else {
			$this->data['tnt2011_eu2_rb05'] = $this->config->get('tnt2011_eu2_rb05');
		}
		// Eind Europa II

		// Europa III
		if (isset($this->request->post['tnt2011_eu3_rb01'])) {
			$this->data['tnt2011_eu3_rb01'] = $this->request->post['tnt2011_eu3_rb01'];
		} else {
			$this->data['tnt2011_eu3_rb01'] = $this->config->get('tnt2011_eu3_rb01');
		}

		if (isset($this->request->post['tnt2011_eu3_rb02'])) {
			$this->data['tnt2011_eu3_rb02'] = $this->request->post['tnt2011_eu3_rb02'];
		} else {
			$this->data['tnt2011_eu3_rb02'] = $this->config->get('tnt2011_eu3_rb02');
		}

		if (isset($this->request->post['tnt2011_eu3_rb03'])) {
			$this->data['tnt2011_eu3_rb03'] = $this->request->post['tnt2011_eu3_rb03'];
		} else {
			$this->data['tnt2011_eu3_rb03'] = $this->config->get('tnt2011_eu3_rb03');
		}
		// Eind Europa III

		// Rest van de Wereld
		if (isset($this->request->post['tnt2011_wereld_rb01'])) {
			$this->data['tnt2011_wereld_rb01'] = $this->request->post['tnt2011_wereld_rb01'];
		} else {
			$this->data['tnt2011_wereld_rb01'] = $this->config->get('tnt2011_wereld_rb01');
		}

		if (isset($this->request->post['tnt2011_wereld_rb02'])) {
			$this->data['tnt2011_wereld_rb02'] = $this->request->post['tnt2011_wereld_rb02'];
		} else {
			$this->data['tnt2011_wereld_rb02'] = $this->config->get('tnt2011_wereld_rb02');
		}

		if (isset($this->request->post['tnt2011_wereld_rb03'])) {
			$this->data['tnt2011_wereld_rb03'] = $this->request->post['tnt2011_wereld_rb03'];
		} else {
			$this->data['tnt2011_wereld_rb03'] = $this->config->get('tnt2011_wereld_rb03');
		}
		// Eind Rest van de Wereld

		// Discounts for letterbox mail
		// Netherlands
		if (isset($this->request->post['tnt2011_discount_nl_std'])) {
			$this->data['tnt2011_discount_nl_std'] = $this->request->post['tnt2011_discount_nl_std'];
		} else {
			$this->data['tnt2011_discount_nl_std'] = $this->config->get('tnt2011_discount_nl_std');
		}

		if (isset($this->request->post['tnt2011_discount_nl_aan'])) {
			$this->data['tnt2011_discount_nl_aan'] = $this->request->post['tnt2011_discount_nl_aan'];
		} else {
			$this->data['tnt2011_discount_nl_aan'] = $this->config->get('tnt2011_discount_nl_aan');
		}

		if (isset($this->request->post['tnt2011_discount_nl_rem'])) {
			$this->data['tnt2011_discount_nl_rem'] = $this->request->post['tnt2011_discount_nl_rem'];
		} else {
			$this->data['tnt2011_discount_nl_rem'] = $this->config->get('tnt2011_discount_nl_rem');
		}

		// end Netherlands

		// Discount Lettermail Europe and ROW

		if (isset($this->request->post['tnt2011_discount_eu1_std'])) {
			$this->data['tnt2011_discount_eu1_std'] = $this->request->post['tnt2011_discount_eu1_std'];
		} else {
			$this->data['tnt2011_discount_eu1_std'] = $this->config->get('tnt2011_discount_eu1_std');
		}

		if (isset($this->request->post['tnt2011_discount_eu1_aan'])) {
			$this->data['tnt2011_discount_eu1_aan'] = $this->request->post['tnt2011_discount_eu1_aan'];
		} else {
			$this->data['tnt2011_discount_eu1_aan'] = $this->config->get('tnt2011_discount_eu1_aan');
		}

		if (isset($this->request->post['tnt2011_discount_world_std'])) {
			$this->data['tnt2011_discount_world_std'] = $this->request->post['tnt2011_discount_world_std'];
		} else {
			$this->data['tnt2011_discount_world_std'] = $this->config->get('tnt2011_discount_world_std');
		}

		if (isset($this->request->post['tnt2011_discount_world_aan'])) {
			$this->data['tnt2011_discount_world_aan'] = $this->request->post['tnt2011_discount_world_aan'];
		} else {
			$this->data['tnt2011_discount_world_aan'] = $this->config->get('tnt2011_discount_world_aan');
		}

		 // end discount letter mail

		// Discount for Parcels
		// Netherlands

		if (isset($this->request->post['tnt2011_discount_nl_parcel_std'])) {
			$this->data['tnt2011_discount_nl_parcel_std'] = $this->request->post['tnt2011_discount_nl_parcel_std'];
		} else {
			$this->data['tnt2011_discount_nl_parcel_std'] = $this->config->get('tnt2011_discount_nl_parcel_std');
		}

		if (isset($this->request->post['tnt2011_discount_nl_parcel_aan'])) {
			$this->data['tnt2011_discount_nl_parcel_aan'] = $this->request->post['tnt2011_discount_nl_parcel_aan'];
		} else {
			$this->data['tnt2011_discount_nl_parcel_aan'] = $this->config->get('tnt2011_discount_nl_parcel_aan');
		}

		if (isset($this->request->post['tnt2011_discount_nl_parcel_ver'])) {
			$this->data['tnt2011_discount_nl_parcel_ver'] = $this->request->post['tnt2011_discount_nl_parcel_ver'];
		} else {
			$this->data['tnt2011_discount_nl_parcel_ver'] = $this->config->get('tnt2011_discount_nl_parcel_ver');
		}

		if (isset($this->request->post['tnt2011_discount_nl_parcel_rem'])) {
			$this->data['tnt2011_discount_nl_parcel_rem'] = $this->request->post['tnt2011_discount_nl_parcel_rem'];
		} else {
			$this->data['tnt2011_discount_nl_parcel_rem'] = $this->config->get('tnt2011_discount_nl_parcel_rem');
		}

		if (isset($this->request->post['tnt2011_discount_nl_parcel_spoed'])) {
			$this->data['tnt2011_discount_nl_parcel_spoed'] = $this->request->post['tnt2011_discount_nl_parcel_spoed'];
		} else {
			$this->data['tnt2011_discount_nl_parcel_spoed'] = $this->config->get('tnt2011_discount_nl_parcel_spoed');
		}

		// end Netherlands
		// Europa I
		if (isset($this->request->post['tnt2011_discount_eu1_parcel_std'])) {
			$this->data['tnt2011_discount_eu1_parcel_std'] = $this->request->post['tnt2011_discount_eu1_parcel_std'];
		} else {
			$this->data['tnt2011_discount_eu1_parcel_std'] = $this->config->get('tnt2011_discount_eu1_parcel_std');
		}

		if (isset($this->request->post['tnt2011_discount_eu1_parcel_ver'])) {
			$this->data['tnt2011_discount_eu1_parcel_ver'] = $this->request->post['tnt2011_discount_eu1_parcel_ver'];
		} else {
			$this->data['tnt2011_discount_eu1_parcel_ver'] = $this->config->get('tnt2011_discount_eu1_parcel_ver');
		}

		if (isset($this->request->post['tnt2011_discount_eu1_parcel_aan'])) {
			$this->data['tnt2011_discount_eu1_parcel_aan'] = $this->request->post['tnt2011_discount_eu1_parcel_aan'];
		} else {
			$this->data['tnt2011_discount_eu1_parcel_aan'] = $this->config->get('tnt2011_discount_eu1_parcel_aan');
		}

		if (isset($this->request->post['tnt2011_discount_eu1_parcel_spoed'])) {
			$this->data['tnt2011_discount_eu1_parcel_spoed'] = $this->request->post['tnt2011_discount_eu1_parcel_spoed'];
		} else {
			$this->data['tnt2011_discount_eu1_parcel_spoed'] = $this->config->get('tnt2011_discount_eu1_parcel_spoed');
		}
		// end Europa I

		// Europa II
		if (isset($this->request->post['tnt2011_discount_eu2_parcel_std'])) {
			$this->data['tnt2011_discount_eu2_parcel_std'] = $this->request->post['tnt2011_discount_eu2_parcel_std'];
		} else {
			$this->data['tnt2011_discount_eu2_parcel_std'] = $this->config->get('tnt2011_discount_eu2_parcel_std');
		}

		if (isset($this->request->post['tnt2011_discount_eu2_parcel_ver'])) {
			$this->data['tnt2011_discount_eu2_parcel_ver'] = $this->request->post['tnt2011_discount_eu2_parcel_ver'];
		} else {
			$this->data['tnt2011_discount_eu2_parcel_ver'] = $this->config->get('tnt2011_discount_eu2_parcel_ver');
		}

		if (isset($this->request->post['tnt2011_discount_eu2_parcel_aan'])) {
			$this->data['tnt2011_discount_eu2_parcel_aan'] = $this->request->post['tnt2011_discount_eu2_parcel_aan'];
		} else {
			$this->data['tnt2011_discount_eu2_parcel_aan'] = $this->config->get('tnt2011_discount_eu2_parcel_aan');
		}

		if (isset($this->request->post['tnt2011_discount_eu2_parcel_spoed'])) {
			$this->data['tnt2011_discount_eu2_parcel_spoed'] = $this->request->post['tnt2011_discount_eu2_parcel_spoed'];
		} else {
			$this->data['tnt2011_discount_eu2_parcel_spoed'] = $this->config->get('tnt2011_discount_eu2_parcel_spoed');
		}
		// end Europa II

		// Europa III
		if (isset($this->request->post['tnt2011_discount_eu3_parcel_std'])) {
			$this->data['tnt2011_discount_eu3_parcel_std'] = $this->request->post['tnt2011_discount_eu3_parcel_std'];
		} else {
			$this->data['tnt2011_discount_eu3_parcel_std'] = $this->config->get('tnt2011_discount_eu3_parcel_std');
		}

		if (isset($this->request->post['tnt2011_discount_eu3_parcel_ver'])) {
			$this->data['tnt2011_discount_eu3_parcel_ver'] = $this->request->post['tnt2011_discount_eu3_parcel_ver'];
		} else {
			$this->data['tnt2011_discount_eu3_parcel_ver'] = $this->config->get('tnt2011_discount_eu3_parcel_ver');
		}

		if (isset($this->request->post['tnt2011_discount_eu3_parcel_aan'])) {
			$this->data['tnt2011_discount_eu3_parcel_aan'] = $this->request->post['tnt2011_discount_eu3_parcel_aan'];
		} else {
			$this->data['tnt2011_discount_eu3_parcel_aan'] = $this->config->get('tnt2011_discount_eu3_parcel_aan');
		}
		// end Europa II

		// Rest of the World
		if (isset($this->request->post['tnt2011_discount_world_parcel_std'])) {
			$this->data['tnt2011_discount_world_parcel_std'] = $this->request->post['tnt2011_discount_world_parcel_std'];
		} else {
			$this->data['tnt2011_discount_world_parcel_std'] = $this->config->get('tnt2011_discount_world_parcel_std');
		}

		if (isset($this->request->post['tnt2011_discount_world_parcel_ver'])) {
			$this->data['tnt2011_discount_world_parcel_ver'] = $this->request->post['tnt2011_discount_world_parcel_ver'];
		} else {
			$this->data['tnt2011_discount_world_parcel_ver'] = $this->config->get('tnt2011_discount_world_parcel_ver');
		}

		if (isset($this->request->post['tnt2011_discount_world_parcel_aan'])) {
			$this->data['tnt2011_discount_world_parcel_aan'] = $this->request->post['tnt2011_discount_world_parcel_aan'];
		} else {
			$this->data['tnt2011_discount_world_parcel_aan'] = $this->config->get('tnt2011_discount_world_parcel_aan');
		}
		// end Rest of the World

		// End of Discounts


		$this->load->model('localisation/geo_zone');

		$geo_zones = $this->model_localisation_geo_zone->getGeoZones();

		foreach ($geo_zones as $geo_zone) {
			if (isset($this->request->post['tnt2011_' . $geo_zone['geo_zone_id'] . '_rate'])) {
				$this->data['tnt2011_' . $geo_zone['geo_zone_id'] . '_rate'] = $this->request->post['tnt2011_' . $geo_zone['geo_zone_id'] . '_rate'];
			} else {
				$this->data['tnt2011_' . $geo_zone['geo_zone_id'] . '_rate'] = $this->config->get('tnt2011_' . $geo_zone['geo_zone_id'] . '_rate');
			}

			if (isset($this->request->post['tnt2011_' . $geo_zone['geo_zone_id'] . '_status'])) {
				$this->data['tnt2011_' . $geo_zone['geo_zone_id'] . '_status'] = $this->request->post['tnt2011_' . $geo_zone['geo_zone_id'] . '_status'];
			} else {
				$this->data['tnt2011_' . $geo_zone['geo_zone_id'] . '_status'] = $this->config->get('tnt2011_' . $geo_zone['geo_zone_id'] . '_status');
			}
		}

		$this->data['geo_zones'] = $geo_zones;

		if (isset($this->request->post['tnt2011_tax_class_id'])) {
			$this->data['tnt2011_tax_class_id'] = $this->request->post['tnt2011_tax_class_id'];
		} else {
			$this->data['tnt2011_tax_class_id'] = $this->config->get('tnt2011_tax_class_id');
		}

		if (isset($this->request->post['tnt2011_status'])) {
			$this->data['tnt2011_status'] = $this->request->post['tnt2011_status'];
		} else {
			$this->data['tnt2011_status'] = $this->config->get('tnt2011_status');
		}

		if (isset($this->request->post['tnt2011_sort_order'])) {
			$this->data['tnt2011_sort_order'] = $this->request->post['tnt2011_sort_order'];
		} else {
			$this->data['tnt2011_sort_order'] = $this->config->get('tnt2011_sort_order');
		}

		$this->load->model('localisation/tax_class');

		$this->data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();

		$this->template = 'shipping/tnt2011.tpl';
		$this->children = array(
			'common/header',
			'common/footer',
		);

		$this->response->setOutput($this->render());
	}

	private function validate() {
		if (!$this->user->hasPermission('modify', 'shipping/tnt2011')) {
			$this->error['warning'] = $this->language->get('error_permission');
		}

		if (!$this->error) {
			return true;
		} else {
			return false;
		}
	}
}
?>